package _0_语法._3_分支;

import java.util.Scanner;

public class _9_求几位数1 {

    public static void main(String[] args) {


        Scanner scanner = new Scanner(System.in);
        int num;
        System.out.println("请输入一个不多于5位的正整数：");
        num = scanner.nextInt();

        if(num > 9999 && num < 100000){
            System.out.println("5位数");
        } else if (num > 999 && num < 10000) {
            System.out.println("4位数");
        } else if (num > 99 && num < 1000) {
            System.out.println("3位数");
        } else if (num > 9 && num < 100) {
            System.out.println("2位数");
        } else if (num > 0 && num < 10){
            System.out.println("1位数");
        } else {
            System.out.println("输入的数字不合法");
        }
    }
}
